using Godot;

namespace RoboRampage.Player;

[Tool]
public partial class Crosshair : Control
{
    // 重写_Draw方法，绘制十字准星
    public override void _Draw()
    {
        // 绘制一个半径为4的圆，颜色为DimGray 深灰色
        DrawCircle(Vector2.Zero, 4, new Color(Colors.DimGray));
        // 绘制一个半径为3的圆，颜色为White
        DrawCircle(Vector2.Zero, 3, new Color(Colors.White));

        // 绘制一条从(16,0)到(24,0)的线，颜色为White，宽度为2
        DrawLine(new Vector2(16, 0), new Vector2(24, 0), new Color(Colors.White), 2);
        
        DrawLine(new Vector2(-16, 0), new Vector2(-24, 0), new Color(Colors.White), 2);
        DrawLine(new Vector2(0, 16), new Vector2(0, 24), new Color(Colors.White), 2);
        DrawLine(new Vector2(0, -16), new Vector2(0, -24), new Color(Colors.White), 2);
        // 如果只在编辑器中执行一些代码
        if (Engine.IsEditorHint())
        {
        }
    }
}